update swagger tooling for code generator - #25
Conversation
b289973 to
c8672bd
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates Swagger tooling to support code generation, introducing new customizers and utilities while reorganizing the package structure and updating dependencies.
- Refactored support test classes from
supportto_supportpackage - Added new Swagger customizers for code generation with metadata utilities
- Updated Spring Boot and related dependencies to newer versions
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Test files (QueryTransformerTest.java, etc.) | Updated import statements to use new _support package structure |
| Support classes (_support/*.java) | Moved from support to _support package with updated internal imports |
| Swagger customizers | Added new customizers for nested structures, custom types, and code generation support |
| SwaggerMetaUtil.java | Added setIsCustomType method for metadata handling |
| SwaggerMeta.java | Added isCustomType field to support code generation metadata |
| TestApp.java | Removed @RegisterCustomTypesWithSwagger annotation |
| pom.xml | Updated Spring Boot, SpringDoc, and Testcontainers versions |
| if (parameter.getSchema() instanceof ObjectSchema | ||
| && parameter.getSchema().get$ref() != null | ||
| ) { | ||
| schemaRef = parameter.getSchema().getItems().get$ref(); |
There was a problem hiding this comment.
This line should use parameter.getSchema().get$ref() instead of parameter.getSchema().getItems().get$ref() when the schema is an ObjectSchema, as ObjectSchema doesn't have items.
| schemaRef = parameter.getSchema().getItems().get$ref(); | |
| schemaRef = parameter.getSchema().get$ref(); |
There was a problem hiding this comment.
@SirCotare check if this is correct, or leave it as is.
There was a problem hiding this comment.
I'm lacking a testcase. But I think it is fine.
| if (parameter.getSchema() instanceof ObjectSchema | ||
| && parameter.getSchema().get$ref() != null | ||
| ) { | ||
| schemaRef = parameter.getSchema().getItems().get$ref(); |
There was a problem hiding this comment.
This line should use parameter.getSchema().get$ref() instead of parameter.getSchema().getItems().get$ref() when the schema is an ObjectSchema, as ObjectSchema doesn't have items.
| schemaRef = parameter.getSchema().getItems().get$ref(); | |
| schemaRef = parameter.getSchema().get$ref(); |
| @Slf4j | ||
| public class CustomTypeParameterCustomizer implements ParameterCustomizer { | ||
|
|
||
| public Optional<Class<?>> getClassFromSchemaReference(String schemaRef) { |
There was a problem hiding this comment.
This method is duplicated across multiple customizer classes. Consider extracting it to a shared utility class to reduce code duplication.
| return parameter; | ||
| } | ||
|
|
||
| public Optional<Class<?>> getClassFromSchemaReference(String schemaRef) { |
There was a problem hiding this comment.
This method is duplicated across multiple customizer classes. Consider extracting it to a shared utility class to reduce code duplication.
| openApi.getComponents().getSchemas().forEach(this::updateSchema); | ||
| } | ||
|
|
||
| public Optional<Class<?>> getClassFromSchemaReference(String schemaRef) { |
There was a problem hiding this comment.
This method is duplicated across multiple customizer classes. Consider extracting it to a shared utility class to reduce code duplication.
| openApi.getComponents().getSchemas().forEach(this::updateSchema); | ||
| } | ||
|
|
||
| public Optional<Class<?>> getClassFromSchemaReference(String schemaRef) { |
No description provided.